package com.suxiaoxiao.springbootlearn.designpattern.commandpattern;

import com.suxiaoxiao.springbootlearn.designpattern.commandpattern.commands.garagedoor.GarageDoor;
import com.suxiaoxiao.springbootlearn.designpattern.commandpattern.commands.garagedoor.GarageDoorOpenCommand;
import com.suxiaoxiao.springbootlearn.designpattern.commandpattern.commands.light.Light;
import com.suxiaoxiao.springbootlearn.designpattern.commandpattern.commands.light.LightOnCommand;

/**
 * 测试类
 * @author 、
 */
public class RemoteControlTest {

    public static void main(String[] args) {
        SimpleRemoteControl remote = new SimpleRemoteControl();
        Light light = new Light();
        LightOnCommand lightOn = new LightOnCommand(light);
        GarageDoor garageDoor = new GarageDoor();
        GarageDoorOpenCommand garageDoorOpen = new GarageDoorOpenCommand(garageDoor);

        remote.setCommand(lightOn);
        remote.buttonWasPressed();
        remote.setCommand(garageDoorOpen);
        remote.buttonWasPressed();
    }

}
